<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_categories', function (Blueprint $table) {
            $table->increments('id')->comment('文章分类表');
            $table->string('category_name', 255)->nullable()->comment('分类名称');
            $table->string('category_img', 255)->nullable()->comment('分类图片');
            $table->integer('category_sort')->nullable()->comment('排序')->default(0);
            $table->tinyInteger('category_level')->nullable()->comment('分类级别')->default(0);
            $table->integer('parent_id')->nullable()->comment('父级分类ID')->default(0);
            $table->tinyInteger('is_show')->nullable()->comment('是否展示')->default(0);
            $table->tinyInteger('is_region')->nullable()->comment('是否限制地区（限制地区后在该分类下发布文章必须选择地区）')->default(0);
            $table->integer('region_id')->nullable()->comment('所属地区ID（1.北洸村）')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_categories');
    }
}
